package com.aaa.controller;

import com.aaa.service.EmpService;
import com.aaa.vo.EmpVo;
import com.aaa.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: work713
 * @description:
 * @author: 李梦朝
 * @create: 2024-07-15 10:54
 **/
@RestController
@RequestMapping("/emp")
public class EmpController {
    @Autowired
    private EmpService empService;
    @GetMapping ("/selectById")
    public Object selectById(Integer empno)
    {
        return empService.selectById(empno);
    }
    @PostMapping ("/insert")
    public Object insert(com.aaa.entity.Emp emp)
    {
        return empService.insert(emp);
    }
    @DeleteMapping ("/delete")
    public Object delete(Integer empno)
    {
        return empService.delete(empno);
    }
    @PutMapping ("/update")
    public Object update(com.aaa.entity.Emp emp)
    {
        return empService.update(emp);
    }
    @PostMapping(value = "/selectByPage")
    public R selectByPage(@RequestBody EmpVo empVo) {
        R selectByPage = empService.selectByPage(empVo);
        return selectByPage;
    }
}
